package cn.yiueil.service.impl;

import cn.yiueil.annotation.LogAnnotation;
import cn.yiueil.entity.User;
import cn.yiueil.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    public static Logger logger;

    static {
        logger = LoggerFactory.getLogger(UserServiceImpl.class);
    }

    @Override
    public User getUser(Long id) {
        return null;
    }

    @Override
    @LogAnnotation(before = "前面", after = "后面", exception = "异常")
    public void login() {
        logger.debug("login");
    }

    @Override
    public void register() {
        logger.debug("register");
    }

    @Override
    @LogAnnotation(before = "前面", after = "后面", exception = "异常")
    public void exception() {
        logger.debug("exception");
        throw new RuntimeException("运行这个方法报错的");
    }
}
